package com.atguigu.spzx.manager.service;

import com.atguigu.spzx.model.dto.system.AssginRoleDto;
import com.atguigu.spzx.model.dto.system.LoginDto;
import com.atguigu.spzx.model.dto.system.SysUserDto;
import com.atguigu.spzx.model.entity.system.SysRole;
import com.atguigu.spzx.model.entity.system.SysUser;
import com.atguigu.spzx.model.vo.system.LoginVo;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;

/**
 * @Author：tzl
 * @Date：2024/1/15 17:32
 * @description: 用户
 */
public interface SysUserService extends IService<SysUser> {
    LoginVo login(LoginDto loginDto);

    /**
     * 登出
     * @param token
     */
    void logout(String token);

    /**
     * 获取登陆的用户数据
     * @return
     */
    SysUser getUserInfo();

    /**
     * 分页查询用户列表
     * @param sysUserDto
     * @param pageNum
     * @param pageSize
     * @return
     */
    Page<SysUser> findByPage(SysUserDto sysUserDto, Integer pageNum, Integer pageSize);

    /**
     * 增加用户
     * @param sysUser
     */
    void saveSysUser(SysUser sysUser);

    /**
     * 修改用户
     * @param sysUser
     */
    void updateSysUser(SysUser sysUser);

    /**
     * 删除用户
     * @param userId
     */
    void deleteById(Long userId);

    /**
     * 分配角色
     * @param assginRoleDto
     */
    void doAssign(AssginRoleDto assginRoleDto);
}
